package com.facade.facade;

/**
 * 爆米花类
 * 回顾以前的知识，使用 饿汉式单例实现
 */
public class Popcorn {
    //饿汉式 一上来就创建单例
    private static final Popcorn popcorn =  new Popcorn();
    //构造方法私有
    private Popcorn(){}

    public static Popcorn getInstance(){
        return popcorn;
    }

    public void on(){
        System.out.println(" Popcorn  on ... ");
    }

    public void off(){
        System.out.println(" Popcorn  off ... ");
    }

    public void play(){
        System.out.println(" Popcorn  is poping  ... ");
    }

    public void pause(){
        System.out.println(" Popcorn  pause ... ");
    }
}
